package hy.impl;

import bean.UserAddress;
import service.UserService;

import java.util.Arrays;
import java.util.List;

//@Service(version = "2.0")//注意：这是dubbo注解
public class UserServiceImpl_old implements UserService {
    @Override
    public UserAddress getUserAddress(String userId) {
        UserAddress a1=new UserAddress(1,"江苏","a1");
        UserAddress a2=new UserAddress(2,"北京","a2");
        List<UserAddress> list= Arrays.asList(a1,a2);
        System.out.println("this is boot provider,version=2.0");
        try {
            Thread.sleep(000);
        } catch (InterruptedException e) {}
        for(int i=0;i<list.size();i++){
            if(list.get(i).getUserId().equals(userId)){
                return list.get(i);
            }
        }
        return null;
    }
}
